package exercise.exer2;

import java.net.SocketTimeoutException;
import java.util.Scanner;

public class excise2 {
    public static void main(String[] args){
        Scanner reader=new Scanner(System.in);
        System.out.println("请输入学生人数：");
        int n=reader.nextInt();
        System.out.printf("请输入%d个学生的成绩:\n",n);
        int []score=new int[n];
        int max=0;
        for(int i=0;i<n;i++) {
            score[i] = reader.nextInt();
            if(max<score[i])
                max=score[i];
        }
        System.out.println("最高分是："+max);
        for(int i=0;i<n;i++){
            if(score[i]>max-10)
                System.out.printf("student %d score is %d grade is A\n",i,score[i]);
            else
                if(score[i]>max-20)
                    System.out.printf("student %d score is %d grade is B\n",i,score[i]);
                else
                    if(score[i]>max-30)
                        System.out.printf("student %d score is %d grade is C\n",i,score[i]);
                    else
                        System.out.printf("student %d score is %d grade is D\n",i,score[i]);
        }
    }
}
